{extend name="sitehome@style/base"/}
{block name="resources"}
<link rel="stylesheet" href="SNS_CSS/file.css">
<style>
    .category_name{margin-top: 10px;}
    .layui-form-item .layui-form-checkbox {
        margin-top: -12px;
    }
    .layui-btn+.layui-btn {
        margin: 0px 0px 3px 0px;
    }
</style>
{/block}
{block name="main"}

<div class="nc-step">
	<span class="layui-breadcrumb" lay-separator="|" style="visibility: visible;">
		  <a class="nc-step-tab nc-step-active">1 选择栏目</a><span lay-separator="">|</span>
		  <a class="nc-step-tab">2  添加信息</a>
	</span>
</div>
<div class="nc-step-content">
    <div class="nc-step-item layui-form layui-show">
        <div class="layui-collapse" lay-filter="category">
            {foreach $category_list as $key=>$vo }
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">
                    {$vo.name}
                </h2>
                <div class="layui-colla-content layui-show category_{$vo.category_id}">
                    {foreach $vo.child_list as $key=>$val }
                    <div class="layui-btn layui-btn-primary">
                        <span lay-util="next_step" category = '{$val.category_id}'>{$val.name}</span>
                    </div>
                    {/foreach}
                </div>
            </div>
            {/foreach}
        </div>

    </div>
    <div class="nc-step-item info-attribute">
    </div>
</div>

<script type="text/html" id="album_html" >
    {{#  layui.each(d, function(index, item){ }}
    <div class="layui-col-md2 img_{{ index }}" >
        <div class="image-box">
            <img layer-pid="{{ index }}" layer-src="{{ nc.img(item.path) }}" src="{{ nc.img(item.path) }}" />
        </div>
        <div class="image-title">
            <div class="layui-form" >
                <span class="layui-form-item">
                        <input type="hidden" name="check_s[]" value="{{ item.path }}">
                    <!-- <input type="checkbox" name="check[]" lay-skin="primary" title="{{ item.file_name  }}" value="{{ item.id }}" lay-filter="oneChoose"> -->
                </span>
            </div>
        </div>
        <div class="image-link">
            <div >
                <button type="button" class="layui-btn layui-btn-primary layui-btn-xs delfile">删除</button>
                <input type="hidden" value="{{ index }}" class="file_id"/>
            </div>
        </div>
    </div>
    {{#  }); }}
</script>

{/block}
{block name="script"}

<script type="text/javascript">
    // var editor = new Editor("content",{});
    var category_id = 0, category_name;
    var tpl_data = new Object();//地址id数据
    tpl_data.province_id = 0,tpl_data.city_id = 0;
    var url = 'sns://sitehome/info/addInfo';

    //价格面议
    $('body').on('click','.checkbox_my',function () {
        var checkbox_price = $(this).children(".checkbox_price").val();

        if(checkbox_price == 1){
            $('.price').val('面议');
            $('.checkbox_price').val(2);
        }else{
            $('.price').val('');
            $('.checkbox_price').val(1);
        }
    });
</script>

<script src="SNS_JS/add_info.js"></script>
{/block}